"""Added columns to bot settings

Revision ID: d08beb34f56f
Revises: d4e902ba675e
Create Date: 2023-03-06 09:03:43.648785

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = "d08beb34f56f"
down_revision = "d4e902ba675e"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "bot_settings",
        sa.Column("order_archiving_status", sa.Boolean(), server_default="0", nullable=True),
    )
    op.add_column(
        "bot_settings",
        sa.Column("order_notify_status", sa.Boolean(), server_default="0", nullable=True),
    )
    op.add_column(
        "bot_settings",
        sa.Column("order_autorenew_status", sa.Boolean(), server_default="0", nullable=True),
    )
    op.add_column(
        "bot_settings",
        sa.Column("proxy_checker_status", sa.Boolean(), server_default="0", nullable=True),
    )
    op.drop_column("bot_settings", "proxy_checker_active")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "bot_settings",
        sa.Column(
            "proxy_checker_active",
            mysql.TINYINT(display_width=1),
            server_default=sa.text("'0'"),
            autoincrement=False,
            nullable=True,
        ),
    )
    op.drop_column("bot_settings", "proxy_checker_status")
    op.drop_column("bot_settings", "order_autorenew_status")
    op.drop_column("bot_settings", "order_notify_status")
    op.drop_column("bot_settings", "order_archiving_status")
    # ### end Alembic commands ###
